package mc.contents.web;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 14-12-9.
 */
public class SourceConfig {
    private String configName;
    private String charset;
    private Integer pageSize;

    private SourceConfig() {
    }

    private SourceConfig( String configName, String charset, Integer pageSize ) {
        this.configName = configName;
        this.charset = charset;
        this.pageSize = pageSize;
    }

    public String getConfigName() {
        return configName;
    }

    public void setConfigName( String configName ) {
        this.configName = configName;
    }

    public String getCharset() {
        return charset;
    }

    public void setCharset( String charset ) {
        this.charset = charset;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize( Integer pageSize ) {
        this.pageSize = pageSize;
    }

    private static Map<String,SourceConfig> configMap = new HashMap<String,SourceConfig>(  ){
        {
            put( "tmall",new SourceConfig( "TMALL_RANK_CRAW","gb2312",60 ) );
            put( "taobao",new SourceConfig( "TAOBAO_RANK_CRAW","utf-8",44 ) );

            put( "mTaobao",new SourceConfig( "M_TAOBAO_RANK_CRAW","utf-8",20 ) );
            put( "mTmall",new SourceConfig( "M_TMALL_RANK_CRAW","gb2312",60 ) );

            put( "reshelf",new SourceConfig( "reshelf_taobao_craw","utf-8",44 ) );
            put( "dsr",new SourceConfig( "dsr_taobao_craw","utf-8",44 ) );
        }
    };

    public static SourceConfig getSourceConfig( String key ){
        return configMap.get( key );
    }
}